﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Booking_Hotel.DBML;

namespace Booking_Hotel.DAL
{
    public class Supplier_LoaiPhong_DichVuDAO
    {
        ThanhBHotelDataContext tbk = new ThanhBHotelDataContext();

        public void addSupplier_Hotel_LoaiPhong_DichVu(Supplier_Hotel_LoaiPhong_DichVu shld)
        {
            Supplier_Hotel_LoaiPhong_DichVu add = new Supplier_Hotel_LoaiPhong_DichVu
            {
                Supplier_Hotel_LoaiPhongID = shld.Supplier_Hotel_LoaiPhongID,
                TenDichVu = shld.TenDichVu,
                Description = shld.Description
            };
            tbk.Supplier_Hotel_LoaiPhong_DichVus.InsertOnSubmit(add);
            tbk.SubmitChanges();
        }

        public void updateSupplier_Hotel_LoaiPhong_DichVu(Supplier_Hotel_LoaiPhong_DichVu shld)
        {
            Supplier_Hotel_LoaiPhong_DichVu update = tbk.Supplier_Hotel_LoaiPhong_DichVus.Single(ca => ca.Supplier_Hotel_LoaiPhong_DichVuID == (int)shld.Supplier_Hotel_LoaiPhong_DichVuID);
            {
                update.Supplier_Hotel_LoaiPhong_DichVuID = shld.Supplier_Hotel_LoaiPhong_DichVuID;
                update.Supplier_Hotel_LoaiPhongID = shld.Supplier_Hotel_LoaiPhongID;
                update.TenDichVu = shld.TenDichVu;
                update.Description = shld.Description;
            }
            tbk.SubmitChanges();
        }
    }
}